package svc

import (
	"github.com/tal-tech/go-zero/core/stores/sqlx"
	"github.com/tal-tech/go-zero/zrpc"
	"newwater/app/identity/cmd/rpc/identity"
	"newwater/app/user/cmd/rpc/internal/config"
	"newwater/app/user/model"
)

type ServiceContext struct {
	Config config.Config
	WaterUser	model.WaterUserModel
	////rpc服务
	IdentityRpc identity.Identity
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,
		WaterUser : model.NewWaterUserModel(sqlx.NewMysql(c.Mysql.DataSource),c.Cache),
		IdentityRpc: identity.NewIdentity(zrpc.MustNewClient(c.IdentityRpcConf)),
	}
}
